﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text;

namespace Helpers
{
    public class MqConfig
    {
        public const string SectionName = "mq";
        public MqConfig()
        {
        }

        /// <summary>
        ///  访问消息队列的用户名
        /// </summary>
        [Required]
        public string UserName { get; set; }
        /// <summary>
        ///  访问消息队列的密码
        /// </summary>
        [Required]
        public string Password { get; set; }
        /// <summary>
        ///  消息队列的主机地址
        /// </summary>
        [Required]
        public string HostName { get; set; }
        /// <summary>
        ///  消息队列的主机开放的端口
        /// </summary>
        [Required]
        public int Port { get; set; }
        /// <summary>
        /// 虚拟机
        /// </summary>
        [Required]
        public string vHost { get; set; }
        /// <summary>
        /// 交换机
        /// </summary>
        [Required]
        public string ExchangeName { get; set; }
        /// <summary>
        /// 并发数
        /// </summary>
        public ushort? PrefetchCount { get; set; }
        /// <summary>
        /// 是否自动应答,默认是false,需要手动ack
        /// </summary>
        public bool AutoAck { get; set; } = false;
        /// <summary>
        /// 是否持久化
        /// </summary>
        public bool Durable { get; set; } = true;
        /// <summary>
        /// 是否调试模式,调试模式会输出日志
        /// </summary>
        public bool IsDebug { get; set; } = true;
    }
}
